﻿@model PagedList<RBS.Web.Hotel.Models.Dine.OrderViewModel>
@using Webdiyer.WebControls.Mvc
@{
    ViewBag.Title = "订单列表";
    Layout = "~/Views/Shared/_Layout.cshtml";

    AjaxOptions ajaxOpts = new AjaxOptions
    {
        UpdateTargetId = "divOrderContainer",
        Url = Url.Action("OrderList")
    };
}
<style> 
</style>
<script>
    $(function () {
        $("#btnDelete").click(function () {
            var f_str = "";
            $(".ltable :checkbox[id='chkId']").each(function () {
                if (this.checked && this.value != "undefined") {
                    f_str += this.value + ',';
                }
            });
            $.dialog.confirm("删除记录后不可恢复，您确定吗？", function () {
                var url = '@Url.Action("AdminUserDelete")?ids=' + f_str;
                $.ajax({
                    url: url,
                    type: "post",
                    dataType: 'json',
                    success: function (data) {
                        if (data.IsSuccess) {
                            $.dialog.alert(data.Msg);
                            loadPage(data.Data);
                        }
                        else {
                            //  $("#msgtip").text(data.Msg);
                            $.dialog.alert(data.Msg);
                        }
                    }
                });
            });
            return false;
        }); 
    });
</script>


<!--导航栏-->
@{
    @Html.Partial("_Location");
}
<!--/导航栏-->
<!--工具栏-->
<div class="toolbar-wrap">
    <div id="floatHead" class="toolbar">
        <div class="l-list">
            <ul class="icon-list"> 
                <li><a class="add" href="AddOrder"><i></i><span>新增</span></a></li>
               @* <li><a class="all" href="javascript:;" onclick="checkAll(this);"><i></i><span>全选</span></a></li>
                <li><a id="btnDelete" class="del" href="#"><i></i><span>删除</span></a></li>*@
            </ul> 
        </div> 
        <div class="r-list">
              @using (Ajax.BeginForm("OrderList", new RouteValueDictionary { { "id", "" } },
                                                new AjaxOptions { UpdateTargetId = "divOrderContainer", InsertionMode = InsertionMode.Replace },
                                                new RouteValueDictionary { { "id", "searchForm" } }))
            {
                <div class="menu-list focus">
                    <div class="rule-single-select">
                        <select name="orderState" id="orderState">
                            <option value="">订单状态</option>
                            <option value="2">已预定</option>
                          
                            <option value="4">就餐中</option>
                          @*  <option value="5">待评论</option> 
                            <option value="6">已评论</option> *@
                            <option value="7">已完成</option> 
                           <option value="3">已取消</option>
                        </select>
                    </div>
                    <div class="rule-single-select">
                        <select name="orderChannel" id="orderChannel">
                            <option value="">下单渠道</option>
                            <option value="网站">网站</option>
                            <option value="手机预订">手机</option>
                            <option value="电话">电话</option>
                            <option value="店面">店面</option>
                        </select>
                    </div>  
                    <label for="beginDate">订单日期:</label>
                        <input id="beginDate" name="beginDate" style="width: 100px" type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" onchange="javascript:ValidEndTime.focus()" class="input date" value="" />
                    <label for="orderId">编号/手机/姓名:</label>
                        <input id="orderId" name="orderId" class="input date" type="text" value="" /> 
                    <input type="button" id="btnSubmit" value="查询" accesskey="S" class="btn" />
                </div>
            }
        </div>
    </div>
</div>
<!--/工具栏-->

<div id="divOrderContainer">
    @*<center>
        <img src="~/Content/Images/onLoading.gif" />
    </center>*@
    @Html.Partial("_OrderList", Model)
</div>

@section Scripts
{
    @{Html.RegisterMvcPagerScriptResource();}

}

<script type="text/javascript">

    $(function () {
        $("#btnSubmit").click(function () {
            $("form").submit();
        })
    })
</script>
